home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.2 / Video Toaster v4.2.iso / arexx / modeler / fractalize.lwm < prev    next >
Text File  |  1993-12-13  |  1KB  |  42 lines

  1. /* CMD: Fractalize
  2.  * iterate a process of subdivide and jitter to make a fractal like object
  3.  * By Arnie Cachelin © 1992, 1993 NewTek Inc. */
  4.  
  5. libadd = addlib("LWModelerARexx.port",0)
  6. call req_begin 'Fractalize'
  7.  
  8. id_cnt = req_addcontrol("Levels (1-4)", "n",1)
  9. id_noise = req_addcontrol("Noise (%)", "n",1)
  10. id_mes = req_addcontrol("This operation", "T","could take a long time,")
  11. id_mes = req_addcontrol("and create very", "T","many points if Level is high")
  12. call req_setval id_cnt, 2
  13. call req_setval id_noise, 5
  14. if (~req_post()) then do
  15.     call req_end
  16.     exit
  17. end
  18. cnt = req_getval(id_cnt)
  19. noise = req_getval(id_noise)
  20. call req_end
  21. scalefactor=noise/100
  22. box=boundingbox()
  23. parse var box n x1 x2 y1 y2 z1 z2
  24. size=scalefactor * ((x2-x1)+(y2-y1)+(z2-z1))/3
  25. call Triple()
  26. call Jitter(size)
  27. do l=2 to cnt
  28.   call Subdivide('SMOOTH')
  29.   size=size*scalefactor
  30.   call Jitter(size)
  31.   end
  32. if (libadd) then call remlib("LWModelerARexx.port")
  33. exit
  34.  
  35. syntax:
  36. error:
  37.   call end_all
  38.     t=Notify(1,'!Rexx Script Error','@'ErrorText(rc),'Line 'SIGL)
  39.   if (libadd) then call remlib("LWModelerARexx.port")
  40.     exit
  41.  
  42.